package org.ttitfly.zuoyue.web.complaint;

import java.util.List;

import javax.annotation.Resource;

import org.ttitfly.ttcore.util.annotation.IsSearchObject;
import org.ttitfly.ttcore.util.annotation.PageSize;
import org.ttitfly.ttcore.web.CrudActionSupport;
import org.ttitfly.zuoyue.entity.complaint.Complaint;
import org.ttitfly.zuoyue.service.complaint.ComplaintManager;
import org.ttitfly.zuoyue.so.complaint.ComplaintSO;

public class ComplaintAction extends CrudActionSupport<Complaint> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Resource
	private ComplaintManager complaintManager;

	@IsSearchObject
	private ComplaintSO complaintSO;

	@PageSize(15)
	private ComplaintPageList pageList;


	public ComplaintManager getComplaintManager() {
		return complaintManager;
	}

	public void setComplaintManager(ComplaintManager complaintManager) {
		this.complaintManager = complaintManager;
	}

	public ComplaintSO getComplaintSO() {
		return complaintSO;
	}

	public void setComplaintSO(ComplaintSO complaintSO) {
		this.complaintSO = complaintSO;
	}

	public ComplaintPageList getPageList() {
		return pageList;
	}

	public void setPageList(ComplaintPageList pageList) {
		this.pageList = pageList;
	}

	public String first() throws Exception {
		return SUCCESS;
	}

	@Override
	public String execute() throws Exception {
		pageList = new ComplaintPageList(complaintSO, complaintManager);
		return SUCCESS;
	}


	// public String complaintJson() throws Exception{
	// BigClient bigClient = new BigClient();
	// bigClient.setId(new Long(1));
	// bigClient.setComBigAddress(11);
	// bigClient.setComBigClientLinkMan("马海波");
	// bigClient.setComBigClientLinkTel("13989894611");
	// list.add(bigClient);
	// return SUCCESS;
	// }

	public List<Complaint> getDataList() {
		return pageList.getObjectList();
	}

	public int getTotalCount() {
		return pageList.getObjectCount();
	}

	@Override
	public String delete() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String input() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String list() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected void prepareModel() throws Exception {
		// TODO Auto-generated method stub

	}

	@Override
	public String save() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Complaint getModel() {
		// TODO Auto-generated method stub
		return null;
	}

	// public int getLimit() {
	// return limit;
	// }
	//
	//
	// public void setLimit(int limit) {
	// this.limit = limit;
	// }
	//
	//
	// public int getStart() {
	// return start;
	// }
	//
	//
	// public void setStart(int start) {
	// this.start = start;
	// }

}
